Return a copy of the original page setup if the dialog was canceled.
authorMatthias Clasen <mclasen@redhat.com>
Mon, 24 Apr 2006 14:37:45 +0000 (14:37 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 24 Apr 2006 14:37:45 +0000 (14:37 +0000)
2006-04-24  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkprintoperation-unix.c (gtk_print_run_page_setup_dialog):
Return a copy of the original page setup if the dialog was canceled.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkprintoperation-unix.c

index ecc5736985e5de7655b2591f7b1264c8e99604fd..dbd9407a0ef8e42d0a274417e1c11035f512682e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-24  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkprintoperation-unix.c (gtk_print_run_page_setup_dialog): 
+       Return a copy of the original page setup if the dialog was canceled.
+
 2006-04-24  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkprintjob.h:
index ecc5736985e5de7655b2591f7b1264c8e99604fd..dbd9407a0ef8e42d0a274417e1c11035f512682e 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-24  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkprintoperation-unix.c (gtk_print_run_page_setup_dialog): 
+       Return a copy of the original page setup if the dialog was canceled.
+
 2006-04-24  Alexander Larsson  <alexl@redhat.com>
 
        * gtk/gtkprintjob.h:
index 1257fc0db8e0e258f1fa4c72c401eda3e8c839b2..b5122ae82290e550b4a843152b9f147221ce7e00 100644 (file)
@@ -245,12 +245,18 @@ gtk_print_run_page_setup_dialog (GtkWindow        *parent,
                                               page_setup);
   gtk_page_setup_unix_dialog_set_print_settings (GTK_PAGE_SETUP_UNIX_DIALOG (dialog),
                                                 settings);
-  gtk_dialog_run (GTK_DIALOG (dialog));
-
-  new_page_setup = gtk_page_setup_unix_dialog_get_page_setup (GTK_PAGE_SETUP_UNIX_DIALOG (dialog));
-
+  if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
+    new_page_setup = gtk_page_setup_unix_dialog_get_page_setup (GTK_PAGE_SETUP_UNIX_DIALOG (dialog));
+  else 
+    {
+      if (page_setup)
+       new_page_setup = gtk_page_setup_copy (page_setup);
+      else
+       new_page_setup = gtk_page_setup_new ();
+    }
+      
   gtk_widget_destroy (dialog);
-
+  
   return new_page_setup;
 }